<%@page import="javax.swing.text.StyledEditorKit.BoldAction"%>
<%@page import="javax.swing.text.StyledEditorKit.BoldAction"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<%@ include file="/static/include/common.inc"%>
<title>青州市名卡管理系统</title>
<link rel="shortcut icon"
	href="https://github.com/shuaijunlan/Autumn-Framework/raw/master/favicon.ico"
	type="image/x-icon" />
	
<link rel="stylesheet" href="static/admin/css/layui.css">
<link rel="stylesheet" href="static/admin/css/main.css" media="all">
</head>
<script src="static/js/jquery-1.11.2.js"></script>
<body>
 <%  
	Map<String, Object> map =(Map<String, Object>) request.getAttribute("map") ;
	String type =(String) request.getAttribute("type") ;
    Map<String, String> textMap =(Map<String, String>)map.get("text");
    Map<String,String> imgMap =(Map<String,String>)map.get("img");
    String disabled = (String)map.get("textMap");
    if(textMap!=null){
    	for(String text : textMap.keySet()){
 %>  
 	<div class="layui-form-item">
	    <label class="layui-form-label"><%=text %></label>
	    <div class="layui-input-block">
	      <input type="text" name="title" autocomplete="off"  class="layui-input" value="<%=textMap.get(text) %>" disabled="<%=disabled %>">
	    </div>
	</div> 

<%
    	}
    } 
    if(imgMap!=null){
    	for(String img : imgMap.keySet()){
%>
	 <div class="layui-form-item layui-form-text">
	    <label class="layui-form-label"><%=img %></label>
	    <div class="layui-input-block">
	      <img src="<%=imgMap.get(img) %> "style="height: auto;width: auto;max-height: 100%;max-width: 80%">
	    </div>
	 </div>
	
<%
    	}
    }
    if(type!=null&&"edit".equals(type)){
%>

	<div class="layui-upload">
		<div class="layui-input-block">
			<form id="img">
				<input  type="file" name="file" width="120px" >
			</form>
	 	</div>
	</div> 
<%
   }
%>
<script type="text/javascript">

function getForm() {
	var form = new FormData(document.getElementById("img"));
	return form;
}

	
</script> 

</body>

</html>